import authService from './authService';
import merchantService from './merchantService';
import tablesService from './tablesService';
import areasService from './areasService';
import productService from './productService';
import tradeService from './tradeService';
import userService from './userService';
import appConfigService from './appConfigService';
import { dataService } from './dataService';
import TokenManager from './tokenManager';

// 导出API基础服务
export { default as baseApi } from './baseApi';

// 导出Token管理器
export { default as TokenManager } from './tokenManager';

// 导出服务
export { 
  authService, 
  merchantService, 
  tablesService,
  areasService,
  productService,
  tradeService,
  userService,
  appConfigService,
  dataService
};

// 导出商户相关函数
export { 
  getMerchantId,
  setMerchantId,
  clearMerchantId
} from './merchantService';

// 从tablesService导出类型
export type {
  Table,
  TableListResponse,
  TableListParams,
  CreateTableParams,
  UpdateTableParams
} from './tablesService';

// 从merchantService导出类型
export type { 
  Merchant,
  MerchantListParams,
  MerchantListResponse
} from './merchantService';

// 从areasService导出类型
export type {
  Area,
  AreaListParams,
  AreaListResponse,
  AreaCreateParams
} from './areasService';

// 从productService导出类型
export type {
  Product,
  ProductListParams,
  ProductListResponse
} from './productService';

// 从tradeService导出类型
export type {
  Address,
  TradeOrderItem,
  CreateTradeParams,
  TradeResponse
} from './tradeService';

// 从userService导出类型
export type {
  User,
  BalanceRecord,
  UserListResponse,
  UserDetailResponse,
  RecordListResponse,
  UpdateBalanceRequest,
  UpdateCreditRequest
} from './userService';

// 从tokenManager导出类型
export type {
  TokenPayload,
  TokenInfo
} from './tokenManager';

// 从appConfigService导出类型
export type {
  AppType,
  AppConfig,
  GetAppConfigResponse,
  SetAppConfigParams,
  SetAppConfigResponse
} from './appConfigService';

// 从dataService导出类型
export type {
  ChartListItem,
  ChartDataParams,
  ChartDataResponse,
  SummaryDataResponse,
  ApiResponse as DataApiResponse
} from './dataService';

// 默认导出所有服务
export default {
  authService,
  merchantService,
  tablesService,
  areasService,
  productService,
  tradeService,
  userService,
  appConfigService,
  dataService,
  TokenManager
}; 